package com.example.demo.thy32controller;

import com.example.demo.thy32model.people;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class th32 {
    @Autowired
    public people user;

    Logger log =LoggerFactory .getLogger(th32.class ) ;
    @RequestMapping ("/th")
    public String thyDemo(Model model ){
        log.info("用户访问了/TH controller--th demo1") ;
        log.debug("用户访问了/TH controller--th demo1") ;
        log.error("程序在执行TH32的时候发生错误") ;
        log.warn("这是一个警告！！！") ;

     // user.setUsername("www");
        user .setRole("admin");
        model .addAttribute("user",user ) ;

    return "thymeleafdemo";
    }

}
